using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace OA.Model
{

    public class DialogField:Base
    {

        /// <summary>
        /// ID
        /// </summary>
        public virtual int ID { get; set; }

        /// <summary>
        /// 对话框编号
        /// </summary>
        public virtual string DialogCode { get; set; }

        /// <summary>
        /// 栏位
        /// </summary>
        public virtual string FieldKey { get; set; }

        /// <summary>
        /// 显示名称
        /// </summary>
        public virtual string Title { get; set; }

        /// <summary>
        /// 宽度
        /// </summary>
        public virtual int Width { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public virtual int Sort { get; set; }

        /// <summary>
        /// 是否显示
        /// </summary>
        public virtual bool IsShow { get; set; }        

        /// <summary>
        /// 所属数据选择框
        /// </summary>
        public virtual Dialog Dialog { get; set; }


        public override bool Equals(object obj)
        {
            var ret = false;
            if (obj is DialogField)
            {
                DialogField pk = obj as DialogField;
                ret = (this.DialogCode == pk.DialogCode && this.FieldKey == pk.FieldKey);
            }
            return ret;

        }

        public override int GetHashCode()
        {
            return (this.DialogCode + "_" + this.FieldKey).GetHashCode();
        }

    }
}
